/*
 *  (C) Copyright 2008 Insula T.I. Ltda.
 * 
 *  This file is part of Vulcano.
 *
 *  Vulcano is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Vulcano is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with Vulcano.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.openinsula.vulcano.orm.dao.query.spec;

/**
 * Factory implementation to ease {@link Spec} usage.
 * 
 * @author rebola
 * @author yanaga
 * @since 1.0
 * @see Spec
 */
public final class SpecFactory {

	private SpecFactory() {
	}

	public static AndSpec and(final Spec... expressions) {
		return new AndSpec(expressions);
	}

	public static OrSpec or(final Spec... expressions) {
		return new OrSpec(expressions);
	}

	public static EqualsSpec eq(String propertyName, Object value) {
		return new EqualsSpec(propertyName, value);
	}

	public static NotEqualsSpec ne(String propertyName, Object value) {
		return new NotEqualsSpec(propertyName, value);
	}

	public static GreaterSpec gt(String propertyName, Object value) {
		return new GreaterSpec(propertyName, value);
	}

	public static GreaterOrEqualSpec ge(String propertyName, Object value) {
		return new GreaterOrEqualSpec(propertyName, value);
	}

	public static LesserSpec lt(String propertyName, Object value) {
		return new LesserSpec(propertyName, value);
	}

	public static LesserOrEqualSpec le(String propertyName, Object value) {
		return new LesserOrEqualSpec(propertyName, value);
	}

	public static BetweenSpec between(String propertyName, Object firstValue, Object secondValue) {
		return new BetweenSpec(propertyName, firstValue, secondValue);
	}

	public static InSpec in(String propertyName, Object... values) {
		return new InSpec(propertyName, values);
	}

	public static LikeSpec like(String propertyName, String value) {
		return new LikeSpec(propertyName, value);
	}

	public static LikeSpec ilike(String propertyName, String value) {
		return new LikeSpec(propertyName, value, false);
	}

	public static NullSpec isNull(String propertyName) {
		return new NullSpec(propertyName);
	}

	public static NotNullSpec isNotNull(String propertyName) {
		return new NotNullSpec(propertyName);
	}
}
